/* 
 * File:   DropTable.cpp
 * Author: vikrantsingh
 * 
 * Created on 29 November, 2013, 1:07 AM
 */

#include "DropTable.h"
#include "../dependency/StatusCodes.h"
#include "Validation.h"
#include "../Sysfiles/SysCatalog.h"

DropTable::DropTable() {
}

DropTable::DropTable(const DropTable& orig) {
}

DropTable::~DropTable() {
}

STATUS_CODE DropTable::run(QueryStructures *queryStruct) {
	
		int error = Validation::isValid();
	if (SUCCESS != error) {
		return error;
	}
	SysCatalog catalogUtil;
	catalogUtil.getSchema(queryStruct->tableName.c_str(),
			queryStruct->schema);
	return catalogUtil.deleteTableEntry(queryStruct->schema);
}
